package com.github.ghsea.retry;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.killbill.notificationq.api.NotificationEvent;

/**
 * @author guhai
 */
@Getter
@Setter
@NoArgsConstructor
class RetryableEventWrapper<T> implements NotificationEvent {

    private RetryableEvent<T> event;

    private String actionClassName;

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

    public RetryableEvent<T> getEvent() {
        return event;
    }

    public RetryableEventWrapper<T> setEvent(RetryableEvent<T> event) {
        this.event = event;
        return this;
    }

    public String getActionClassName() {
        return actionClassName;
    }

    public RetryableEventWrapper<T> setActionClassName(String actionClassName) {
        this.actionClassName = actionClassName;
        return this;
    }
}
